<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        #scoreSystem li {
            float: left;
            font-size: 50px;
            margin-right: 10px;
            color: yellow;
        }
    </style>
    <script src="jquery-3.3.1.min.js"></script>
    <script>
        $(function(){
            var flag = 0;
            // 为所有li注册mouseenter/mouseleave/click事件
            $("#scoreSystem>li").mouseenter(function(){
                flag = 0;
                $(this).text("★").prevAll().text("★").end().nextAll().text("☆");
            }).mouseleave(function(){
                if (flag == 0) {
                    $("#scoreSystem>li").text("☆");
                }
            }).click(function(){
                flag = 1;
            });
        });
    </script>
</head>
<body>
    <ul id="scoreSystem" style="list-style:none;">
        <li>☆</li>
        <li>☆</li>
        <li>☆</li>
        <li>☆</li>
        <li>☆</li>
    </ul>
    
</body>
</html>